package com.snpic.appaw.module.third.api.deepOCR.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.util.List;

/**
 * @author JiJun
 * @date 2025/9/11 9:45
 * @修改时间 2025/9/11 9:45
 * @description
 */
@Schema(description = "第三方 - 识别行驶证（正页） Response DTO")
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class VehicleLicenseRespDTO {
	@Schema(description = "错误码,0：正确，1：无法识别，2：图像格式错误")
	private int error_code;

	@Schema(description = "模板名称")
	private String page_name;

	@Schema(description = "结果描述")
	private String description;

	@Schema(description = "唯一请求标识符", example = "239bc15c226911ebbb4200163e0d18d7")
	private String request_id;

	@Schema(description = "识别所用时间（毫秒为单位）", example = "209")
	private int recognize_time;

	@Schema(description = "识别结果")
	private Result result;

	@Data
	public static class Result {
		@Schema(description = "号牌号码")
		private Info plateno;

		@Schema(description = "车辆类型")
		private Info vehicle_type;

		@Schema(description = "所有人")
		private Info owner;

		@Schema(description = "住址")
		private Info address;

		@Schema(description = "使用性质")
		private Info use_character;

		@Schema(description = "品牌型号")
		private Info model;

		@Schema(description = "车辆识别代码")
		private Info vin;

		@Schema(description = "发动机号码")
		private Info engine_no;

		@Schema(description = "注册日期")
		private Info register_date;

		@Schema(description = "发证日期")
		private Info issue_date;

		@Schema(description = "签发机关")
		private Info issue_authority;

		@Schema(description = "检验有效期")
		private Info check_validity;

		@Schema(description = "状态")
		private Info status;

		@Schema(description = "生成时间")
		private Info create_time;
	}

	@Data
	public static class Info {
		@Schema(description = "该字段中文含义")
		private String chinese_key;

		@Schema(description = "识别结果（utf-8格式）")
		private String words;

		@Schema(description = "照片可信度（取值范围为0~1）", example = "0.999838")
		private float score;

		@Schema(description = "四个顶点坐标（所在区域的四个点，依次为左上，右上，右下，左下四个点的坐标值）")
		private String quad;

		@Schema(description = "位置矩形框")
		private Position position;
	}

	@Data
	public static class Position {
		@Schema(description = "矩形框宽度")
		private int width;

		@Schema(description = "矩形框高度")
		private int height;

		@Schema(description = "矩形框顶部距离")
		private int top;

		@Schema(description = "矩形框左侧距离")
		private int left;
	}
}
